#ifndef _LINE_T_H
#define	_LINE_T_H

#include "point.h"


struct line_t
{
    line_t();
    line_t(point_t const & first, point_t const & second);

    bool is_vertical() const;
    bool is_horizontal() const;
    bool is_vertical(double & y) const;
    bool is_horizontal(double & x) const;

    double get_y(double x) const;
    double get_x(double y) const;

    point_pos classify(point_t const & point) const;

    friend bool intersects(line_t const & a, line_t const & b, point_t & intersection);
    friend double distance(line_t const & line, point_t const & point);
    friend double angle(line_t const & l, line_t const & r);

private:
    double a_;
    double b_;
    double c_;
};


#endif	/* _LINE_T_H */
